﻿using System;
using UnityEditor;
using UnityEngine;

public class BaseInspector : Editor
{
    public void ShowArrayProperty(SerializedProperty array, Type type, string label)
    {
        string[] names = (string[])Enum.GetNames(type);
        int beginSize = array.arraySize;
        array.arraySize = names.Length;

        if (beginSize < names.Length)
        {
            for (int i = beginSize; i < names.Length; i++)
            {
                array.GetArrayElementAtIndex(i).objectReferenceValue = null;
            }
        }

        EditorGUILayout.Space();
        EditorGUILayout.LabelField(label, EditorStyles.boldLabel);
        for (int i = 0; i < names.Length; i++)
        {
            SerializedProperty item = array.GetArrayElementAtIndex(i);
            EditorGUILayout.PropertyField(item, new GUIContent(names[i]));
        }
    }

    public void TEXT1()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }
    public void TEXT2()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }
    public void TEXT3()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }

    public void TEXT4()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }

    public void TEXT5()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }

    public void TEXT6()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }

    public void TEXT8()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }

    public void TEXT9()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }

    public void TEXT10()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }

    public void TEXT11()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }

    public void TEXT12()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }

    public void TEXT13()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }

    public void TEXT14()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }

    public void TEXT15()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }

    public void TEXT16()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }

    public void TEXT17()
    {
        int textNum = 1;
        if (textNum == 1)
        {
            textNum = 2;
        }
    }
}